/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function initBancosGrid(){
    $("#bancos_grid").jqGrid({
        url:'getBancosList.do',
        editurl:'modifiBanco.do?action=edit',
        datatype: "json",
        width:900,
 colNames:['','Banco','A nombre de','Sucursal','Cuenta','Cie','Clave'],
        colModel:[
        {
            name:'bancoid',
            index:'bancoid',
            sortable: true, 
            /*editable: true,  
            editoptions:{readonly: true}, */
            hidden: true , 
            editable: true, 
            width:55
        }
        ,{
            name:'descripcion',
            index:'descripcion',
            sortable: true, 
            editable: true,  
            editrules: { required: true},
            editoptions:{readonly: false},        
            width:55
        }
        ,{
            name:'anombrede',
            index:'anombrede',
            sortable: true, 
            editable: true,    
            editrules: { required: true},
            editoptions:{readonly: false},        
            width:55
        },{
            name:'sucursal',
            index:'sucursal',
            sortable: true, 
            editable: true,       
            editoptions:{readonly: false},        
            width:55
        },
        {
            name:'cuenta',
            index:'cuenta',
            sortable: true, 
            editable: true,       
            editoptions:{readonly: false},        
            width:55
        },
        {
            name:'cie',
            index:'cie',
            sortable: true, 
            editable: true,       
            editoptions:{readonly: false},        
            width:55
        },
        {
            name:'clave',
            index:'clave',
            sortable: true, 
            editable: true,       
            editoptions:{readonly: false},        
            width:55
        }
            
          /*,
                {
            name:'actions',
            index:'actions',
            sortable: false, 
            width:80, 
            
            align:"center"
        } */		
  
        ],
        ondblClickRow: function(bancoid){
           // alert(bancoid)    
               
        },
        rowNum:10,
        rowList:[10,20,30],
        pager: '#bancos_pager',
        sortname: 'descripcion',
        viewrecords: true,
        sortable: true,
        sortorder: "desc",
        multiselect: true,
        caption:"Mis Autos Asignados",
        loadonce : false,
        rowTotal: 'total',
        records:'records',
        jsonReader: {
            repeatitems: false,
            id: "bancoid"
        }
    });
    $("#bancos_grid").jqGrid('navGrid','#bancos_pager',{
        edit:true,
        add:true,
        del:true,
        view :false,
        search: false 
    },{closeAfterEdit:true,url:'adcBanco.do?action=edit'},{closeAfterAdd:true,url:'saveBanco.do?action=add'},{url:'adcBanco.do?action=del'});

}
/*
var myDelOptions = {
            
    onclickSubmit: function(rp_ge, rowid) {
                      
      //  alert("The row with rowid="+rowid+" will be deleted");
        
        $("#bancos_grid").delRowData(rowid);
                        

        //                jQuery("#grid_id").jqGrid('saveRow',rowid, false);

        return true;
    },
    url:'adcBanco.do?action=del'
//,  processing:true
};

var myAddOptions = {
            
    onclickSubmit: function(rp_ge, rowid) {
                      
      //  alert("The row with rowid="+rowid+" will be deleted");
        
        $("#bancos_grid").delRowData(rowid);
                        

        //                jQuery("#grid_id").jqGrid('saveRow',rowid, false);

        return true;
    },
    url:'saveBanco.do?action=add'
//,  processing:true
};*/

